<template>
  <div id="cornerComment" v-if="dialogVisible">
    <div class="cornerComment-in">
      <div class="cornerComment-in-title">
        <span>反馈详情</span>
        <span class="el-icon-circle-close close-Btn-line" @click="closePOpup"></span>
      </div>
      <div class="commentBody apply-box-left-from">
        <el-form label-width="90px" ref="editForm">
          <el-form-item label="反馈标题：">
            {{detailOption?detailOption.title: '--'}}
          </el-form-item>
          <el-form-item label="反馈时间：">
            {{detailOption?detailOption.create_time: '--'}}
          </el-form-item>
          <el-form-item label="反馈内容：">
            {{detailOption?detailOption.body: '--'}}
          </el-form-item>
          <el-form-item label="图片说明：" v-if="srcList.length">
            <div class="block" v-for="(item, index) in srcList" :key="index">
              <el-image :src="item" :preview-src-list="srcList"></el-image>
            </div>
          </el-form-item>
          <el-form-item label="图片说明：" v-else>
            无
          </el-form-item>
        </el-form>
      </div>
      <div class="cornerComment-in-footer">
        <el-button @click.native="closePOpup" size="small">返回</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['visible', 'detailOption'], // recruitmentType examine 审核
  components: {},
  data() {
    return {
      dialogVisible: false,
      src: '',
      srcList: []
    }
  },
  watch: {
    visible() {
      this.dialogVisible = this.visible
      if (this.visible) {
        console.log('detailOption:', this.detailOption)
        let pic_ = []
        if(this.detailOption.pic){
          pic_ = this.detailOption.pic.split(',')
          for(let item of pic_){
            this.srcList.push(item)
          }
        }
      }
    }
  },
  created() {

  },
  methods: {
    // 关闭弹窗
    closePOpup() {
      this.$emit('update:visible', false)
    },
    getJson(option) {
      return JSON.parse(JSON.stringify(option))
    },
  },
  mounted() {
  }
}
</script>
<style scoped>
#cornerComment {
  height: 100vh;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
}

.cornerComment-in {
  width: 600px;
  height: 800px;
  background: #fff;
  display: flex;
  flex-direction: column;
  border-radius: 5px;
}

.cornerComment-in-title {
  height: 50px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ddd;
  font-size: 24px;
}

.cornerComment-in-title span {
  padding: 0 10px;
}

.cornerComment-in-title span:first-child {
  flex: 1;
  font-size: 16px;
}

.cornerComment-in-footer {
  height: 50px;
  border-top: 1px solid #ddd;
  display: flex;
  align-items: center;
  padding: 0 10px;
  justify-content: center;
}

.commentBody {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
}

.close-Btn-line {
  cursor: pointer;
}

</style>


